shadowsocks-libev: backport patch for logging with daemon facility
authorYousong Zhou <[email protected]>
Tue, 1 Aug 2017 07:23:47 +0000 (15:23 +0800)
committerYousong Zhou <[email protected]>
Wed, 2 Aug 2017 06:34:49 +0000 (14:34 +0800)
Signed-off-by: Yousong Zhou <[email protected]>
net/shadowsocks-libev/Makefile
net/shadowsocks-libev/patches/0001-decouple-use_syslog-from-pid_flags.patch
net/shadowsocks-libev/patches/0002-syslog-with-daemon-facility-instead-of-kern-0.patch [new file with mode: 0644]

index 54392cb6ccf01084e6d24874c5c193ef4be76c97..492b1c45907339b9b4195bcfebf8af7cb3793f9a 100644 (file)
@@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk
 #
 PKG_NAME:=shadowsocks-libev
 PKG_VERSION:=3.0.8
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/shadowsocks/shadowsocks-libev/releases/download/v$(PKG_VERSION)
index 875f105db3d0e4c48b6aba9cb4a6e1621771215c..174dcdbcc13ef4cc22d4515198bfcfe1644fb5ab 100644 (file)
@@ -1,7 +1,7 @@
-From ea18a4ffcd9a8de4c5b888d9dc58a2b173c5ff8e Mon Sep 17 00:00:00 2001
+From a91d70dd37e9555d104629538890d44ef355c772 Mon Sep 17 00:00:00 2001
 From: Yousong Zhou <[email protected]>
 Date: Mon, 26 Jun 2017 14:49:36 +0800
-Subject: [PATCH] decouple use_syslog from pid_flags
+Subject: [PATCH 1/2] decouple use_syslog from pid_flags
 
 Sometimes we need processes to run in the foreground to be supervised
 and at the same time use syslog facility instead of logging its stdout,
@@ -34,10 +34,10 @@ index 3c58148..05445c3 100644
          }
      } else {
 diff --git a/src/local.c b/src/local.c
-index aa69205..d123516 100644
+index 78f6d29..e4bd477 100644
 --- a/src/local.c
 +++ b/src/local.c
-@@ -1519,8 +1519,8 @@ main(int argc, char **argv)
+@@ -1522,8 +1522,8 @@ main(int argc, char **argv)
          local_addr = "127.0.0.1";
      }
  
@@ -62,10 +62,10 @@ index 6e7197c..338ab85 100644
      }
  
 diff --git a/src/redir.c b/src/redir.c
-index 4856007..88660f8 100644
+index 3809411..fae8d54 100644
 --- a/src/redir.c
 +++ b/src/redir.c
-@@ -1137,8 +1137,8 @@ main(int argc, char **argv)
+@@ -1140,8 +1140,8 @@ main(int argc, char **argv)
  #endif
      }
  
@@ -76,7 +76,7 @@ index 4856007..88660f8 100644
      }
  
 diff --git a/src/server.c b/src/server.c
-index 747f0e5..7e3df9e 100644
+index 534dbd8..1c25c74 100644
 --- a/src/server.c
 +++ b/src/server.c
 @@ -1726,8 +1726,8 @@ main(int argc, char **argv)
diff --git a/net/shadowsocks-libev/patches/0002-syslog-with-daemon-facility-instead-of-kern-0.patch b/net/shadowsocks-libev/patches/0002-syslog-with-daemon-facility-instead-of-kern-0.patch
new file mode 100644 (file)
index 0000000..6d23ecc
--- /dev/null
@@ -0,0 +1,39 @@
+From afe796ce6e7a4164459009c58d7e60862edb0be3 Mon Sep 17 00:00:00 2001
+From: Yousong Zhou <[email protected]>
+Date: Tue, 1 Aug 2017 15:21:38 +0800
+Subject: [PATCH 2/2] syslog with daemon facility instead of kern (0)
+
+---
+ src/utils.h | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/utils.h b/src/utils.h
+index 53f3983..3b624e8 100644
+--- a/src/utils.h
++++ b/src/utils.h
+@@ -99,14 +99,14 @@ extern int use_syslog;
+         use_tty = isatty(STDERR_FILENO); \
+     } while (0)
+-#define USE_SYSLOG(_ident, _cond)                       \
+-    do {                                                \
+-        if (!use_syslog && (_cond)) {                   \
+-            use_syslog = 1;                             \
+-        }                                               \
+-        if (use_syslog) {                               \
+-            openlog((_ident), LOG_CONS | LOG_PID, 0);   \
+-        }                                               \
++#define USE_SYSLOG(_ident, _cond)                               \
++    do {                                                        \
++        if (!use_syslog && (_cond)) {                           \
++            use_syslog = 1;                                     \
++        }                                                       \
++        if (use_syslog) {                                       \
++            openlog((_ident), LOG_CONS | LOG_PID, LOG_DAEMON);  \
++        }                                                       \
+     } while (0)
+ #define LOGI(format, ...)                                                        \
+-- 
+2.12.2
+